package com.guigu.gulicommon.entity.dto;


import com.guigu.gulicommon.entity.pojo.CartItem;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotNull;
import java.util.List;

import static com.guigu.gulicommon.constant.CheckParametersConstant.CART_ITEMS_CANNOT_BE_NULL;
import static com.guigu.gulicommon.constant.CheckParametersConstant.ORDER_SN_CANNOT_BE_NULL;

/**
 * 锁定库存入参
 *
 * @author 陈俊杰
 * @version 1.0
 * @since 2024/9/29 12:05
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class WareSkuLockDto {
    /**
     * 订单号
     */
    @NotNull(message = ORDER_SN_CANNOT_BE_NULL)
    private String orderSn;
    /**
     * 需要锁定库存的购物项
     */
    @NotNull(message = CART_ITEMS_CANNOT_BE_NULL)
    private List<CartItem> locks;
}
